package com.hutu.kboshi.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hutu.kboshi.common.PageRequest;
import com.hutu.kboshi.pojo.dto.question.QuestionAddRequest;
import com.hutu.kboshi.pojo.dto.question.QuestionDto;
import com.hutu.kboshi.pojo.dto.question.QuestionQueryRequest;
import com.hutu.kboshi.pojo.dto.question.QuestionUpdateRequest;
import com.hutu.kboshi.pojo.entity.Question;
import com.hutu.kboshi.pojo.vo.QuestionVO;


import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
* @author 20272
* @description 针对表【question(题目)】的数据库操作Service
* @createDate 2024-09-24 22:41:22
*/
public interface QuestionService {

    /**
     * 分页获取题目封装
     *
     * @param questionPage
     * @param request
     * @return
     */
    Page<QuestionVO> getQuestionVOPage(Page<Question> questionPage, HttpServletRequest request);

    /**
     * 分页获取题目列表
     *
     * @param questionQueryRequest
     * @return
     */
    Page<Question> listQuestionByPage(QuestionQueryRequest questionQueryRequest);



    /**
     * 批量删除题目
     *
     * @param questionIdList
     */

    void batchDeleteQuestions(List<Long> questionIdList);

    boolean save(Question question);

    Question getQuestionById(long questionId);

    boolean deleteByQuestionById(long questionId);

    boolean updateQuestion(QuestionUpdateRequest questionUpdateRequest);

    Page<QuestionDto> getMyQuestionPage(PageRequest pageRequest);

    Boolean saveQuestion(QuestionAddRequest questionAddRequest);


    /*    *//**
     * 从 ES 查询题目
     *
     * @param questionQueryRequest
     * @return
     *//*
    Page<Question> searchFromEs(QuestionQueryRequest questionQueryRequest);*/
}
